#ifndef MYGLWIDGET_H
#define MYGLWIDGET_H

#include <QGLWidget>
#include <vector>
#include "icgobject.h"
#include "scene.h"

class MyGlWidget : public QGLWidget
{
Q_OBJECT
public:
    MyGlWidget(QWidget *parent = 0);
    ~MyGlWidget();

    void initializeGL();
    void paintGL();
    void resizeGL(GLsizei width, GLsizei height);
    void setScene(Scene *scene) { scene_ = scene; }

signals:
    void asking_raycast();

protected:
    void keyPressEvent(QKeyEvent *ev);
//    void keyReleaseEvent(QKeyEvent *ev);

private:
    void updateCamera();
    std::vector<ICgObject*> objects_;
    Scene *scene_;
};

#endif // MYGLWIDGET_H
